#include <iostream>
#include <thread>
#include <unistd.h>
#include <mutex>

thread_local int tlsVar = 0;

void changeVar(int value)
{
    tlsVar = value;
    sleep(value);
    std::cout << "Thread ID: " << std::this_thread::get_id() << " tlsVar: " << tlsVar << std::endl;
}

int main()
{
    std::thread t1(changeVar, 5);
    std::thread t2(changeVar, 10);

    t1.join();
    t2.join();

    return 0;
}
